/**
* 
*/
package com.java.tasks;

import java.text.SimpleDateFormat;
import java.util.Date;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

import com.java.service.impl.ClassroomServiceImpl;

/**
* @author Kidney
* 创建时间：2019年1月30日 下午11:14:09
* Description:定时器
*/
/**
 * @author KIDNEY
 *
 */
@Component
public class Task1 {

	@Autowired
	private ClassroomServiceImpl cls;

	@Scheduled(cron = "0 0 0 ? * SAT")
	public void satDelete() {

		int flag = cls.deleteAll();

		if (flag == 1) {
			Date cTime = new Date();
			SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
			String cTimeString = sdf.format(cTime);
			System.out.println("DELETE SUCCESSFUL " + cTimeString + " siyuan DEMO");
		}
	}

}



